package com.woniuxy.charin.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.charin.model.dto.UserInfoDto;
import com.woniuxy.charin.model.entity.UserActionLog;
import com.woniuxy.charin.service.UserActionLogService;
import com.woniuxy.charin.mapper.UserActionLogMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
* @author KOO
* @description 针对表【user_action_log】的数据库操作Service实现
* @createDate 2025-01-06 19:43:24
*/
@Service
public class UserActionLogServiceImpl extends ServiceImpl<UserActionLogMapper, UserActionLog>
    implements UserActionLogService{

    @Override
    public Page<UserActionLog> queryUser(UserInfoDto account) {
       return baseMapper.selectPage(new Page<>(account.getPageNum(), account.getPageSize()),
                Wrappers.lambdaQuery(UserActionLog.class)
                        .like(StringUtils.isNotBlank(account.getAccount()), UserActionLog::getAccount, account.getAccount())
                        .orderByDesc(UserActionLog::getCreatedAt));
    }
}




